//
//  HEIntInComeCell.m
//  HealthFamily
//
//  Created by 吴欧 on 2020/12/11.
//  Copyright © 2020 honglutec. All rights reserved.
//

#import "HEIntInComeCell.h"

@interface HEIntInComeCell ()

@property (nonatomic, strong) UILabel *titleLb;
@property (nonatomic, strong) UILabel *descLb;
@property (nonatomic, strong) UILabel *timeLb;

@end

@implementation HEIntInComeCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.contentView.backgroundColor = KWhiteColor;
        [self initUI];
    }
    return self;
}

- (void)initUI {
 
    UILabel *titleLb = [UILabel new];
    titleLb.text = @"-";
    titleLb.font = DYBlodFont(16);
    [self.contentView addSubview: titleLb];
    _titleLb = titleLb;
 
    UILabel *descLb = [UILabel new];
    descLb.text = @"-";
    descLb.font = DYBlodFont(16);
    descLb.textColor = CNavBgColor;
    [self.contentView addSubview: descLb];
    _descLb = descLb;
    
    UILabel *timeLb = [UILabel new];
    timeLb.text = @"-";
    timeLb.font = DYBlodFont(15);
    timeLb.textColor = CNavDargGrayColor;
    [self.contentView addSubview: timeLb];
    _timeLb = timeLb;
    
    [_titleLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).mas_offset(15);
        make.left.equalTo(self.contentView).mas_offset(15);
        make.right.equalTo(descLb.mas_left).mas_offset(-10);
    }];
    
    [_descLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.right.equalTo(self.contentView).mas_offset(-15);
    }];
    [_descLb setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
    
    [_timeLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_titleLb.mas_bottom).mas_offset(10);
        make.left.equalTo(self.contentView).mas_offset(15);
        make.right.equalTo(descLb.mas_left).mas_offset(-10);
        make.bottom.equalTo(self.contentView).mas_offset(-10);
    }];
}

- (void)setModel:(HEPointDetailModel *)model {
    _model = model;
    
    _titleLb.text = model.point_name;
    _descLb.text = model.KpointDesc;
    _descLb.textColor = model.KpointDescColor;
    _timeLb.text = model.Ktime;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
